package cn.com.ddapp.ddm.util;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;

import cn.com.ddapp.ddm.R;


/**
 * Created by Administrator on 2016/8/10 0010.
 */
public class GlideUitl {

	public static void getGlide(Context context, String imgpath, ImageView imageView) {
		Glide.with(context)
				.load(imgpath)
				.centerCrop()
				.diskCacheStrategy(DiskCacheStrategy.ALL)
				.error(R.mipmap.ic_launcher)
				.placeholder(R.mipmap.ic_launcher)
				.into(imageView);
	}

	public static void getGlide(Activity activity, String imgpath, ImageView imageView) {
		Glide.with(activity)
				.load(imgpath)
				.centerCrop()
				.diskCacheStrategy(DiskCacheStrategy.ALL)
				.error(R.mipmap.ic_launcher)
				.placeholder(R.mipmap.ic_launcher)
				.into(imageView);
	}

	public static void getGlide(Fragment fragment, String imgpath, ImageView imageView) {
		Glide.with(fragment)
				.load(imgpath)
				.centerCrop()
				.diskCacheStrategy(DiskCacheStrategy.ALL)
				.error(R.mipmap.ic_launcher)
				.placeholder(R.mipmap.ic_launcher)
				.into(imageView);
	}
}
